﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace linkPosWeb.Class
{
    public class kullanicilar
    {
        linksDataContext ln = new linksDataContext();

        private int id;
        public int _id { get { return id; } set { id = value; } }
        private string kullanici;
        public string _kullanici { get { return kullanici; } set { kullanici = value; } }
        private string pass;
        public string _pass { get { return pass; } set { pass = value; } }
        private int firmaid;
        public int _firmaid { get { return firmaid; } set { firmaid = value; } }
        private string isim;
        public string _isim { get { return isim; } set { isim = value; } }
        private string soyisim;
        public string _soyisim { get { return soyisim; } set { soyisim = value; } }
        private int yetki;
        public int _yetki { get { return yetki; } set { yetki = value; } }
        private int passiflik;
        public int _passiflik { get { return passiflik; } set { passiflik = value; } }

        
        public kullanicilar()
        {
            id = 0;
            firmaid = 0;
            yetki = 0;

        }

        public void login()
        {
            var kulss = from i in ln.users
                        where i.username == kullanici && i.password == pass
                        select i;

            if (kulss != null)
            {
                foreach (var item in kulss)
                {
                    id = item.userID;
                    kullanici = item.username;
                    pass = item.password;
                    firmaid =(int)item.companyID;
                    isim = item.name;
                    soyisim = item.surname;
                    yetki = (int)item.status;
                    passiflik = (int)item.passive;

                }
            }
        
        
        }


        public void sspvekle()
        { }

        public void bspvekle()
        { }

        public void badminekle()
        { }

        public void fsuperadminekle()
        { }

        public void fadminekle()
        { }

        public void fspvekle()
        { }

        public void guncelle()
        { }

        public void sil()
        { }

    }
}